package android.bkav.testing.utils;

import android.app.Notification;
import android.app.PendingIntent;
import android.bkav.testing.R;
import android.content.Context;
import android.content.Intent;

public class NewNoteNotification {
	
	private Context context;
	
	public NewNoteNotification(Context context){
		this.context = context;
	}
	
	public Notification createNewNoteNotification(String contentTitle, String contentText, long when, Class<?> cls){
		Notification notifyDetails = new Notification(R.drawable.notification_icon, "You have new note", when);
//		long[] vibrate = {100, 100, 200, 300};
//		notifyDetails.vibrate = vibrate;
//		notifyDetails.defaults = Notification.DEFAULT_ALL;
		notifyDetails.flags = Notification.FLAG_AUTO_CANCEL;
		
		Intent notifyIntent = new Intent(context, cls);
		PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, notifyIntent, android.content.Intent.FLAG_ACTIVITY_NEW_TASK);
		
		notifyDetails.setLatestEventInfo(context, contentTitle, contentText, pendingIntent);
		
		return notifyDetails;
	}
}
